<template>
    <div id="body">
    <div id="main">
        <div style="text-align:center;font-size:28px;margin-bottom:30px">
            <span>小蓝书注册</span>
        </div>
        
        <van-form @submit="onSubmit" >
            <van-cell-group inset>
                <van-field
                v-model="username"
                name="用户名"
                label="用户名"
                placeholder="用户名"
                :rules="[{ required: true, message: '请填写用户名' }]"
                required
                style="margin-bottom:10px"
                />
                <van-field
                v-model="password"
                type="password"
                name="密码"
                label="密码"
                placeholder="密码"
                :rules="[{ required: true, message: '请填写密码' }]"
                required
                style="margin-bottom:10px"
                />
                <van-field
                v-model="repassword"
                type="password"
                name="确认密码"
                label="确认密码"
                placeholder="确认密码"
                :rules="[{ required: true, message: '请重复密码' }]"
                required
                style="margin-bottom:10px"
                />
            </van-cell-group>
            <div style="margin: 16px;">
                <van-button round block type="primary" native-type="submit" @click="register">
                立即注册
                </van-button>
            </div>
            <div style="text-align:center"><a @click="toLogin">已有账号？马上登录</a></div>
        </van-form>
    </div>
</div>
</template>



<script>
export default({
    setup() {
        
    },
    data(){
        return{
            username:"",
            password:"",
            repassword:""
        }
    },
    components:{
    },
    methods: {
        register(){
            
        },
        toLogin(){
            this.$router.replace('/login')
        }
    },
})
</script>

<style scoped>
#main{
    margin-top: 100px;
    
}
#body{
    width: 100%;
    height: 100%;
    /* background:rgba(247, 245, 245, 0) url('../assets/user.jpg') center no-repeat fixed; */
}
</style>